home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / Clueless.swf / scripts / Forms / LevelJumpForm.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  2.8 KB  |  93 lines

  1. package Forms
  2. {
  3.    import flash.events.MouseEvent;
  4.    import flash.text.TextField;
  5.    import flash.text.TextFormat;
  6.    
  7.    [Embed(source="/_assets/assets.swf", symbol="Forms.LevelJumpForm")]
  8.    public class LevelJumpForm extends CluelessBaseForm
  9.    {
  10.        
  11.       
  12.       public var _bMenu:ButtonRound;
  13.       
  14.       protected var _dragcontroller:DragController;
  15.       
  16.       public function LevelJumpForm()
  17.       {
  18.          var _loc1_:int = 0;
  19.          var _loc2_:int = 0;
  20.          var _loc3_:Level = null;
  21.          var _loc4_:TextField = null;
  22.          _dragcontroller = new DragController();
  23.          super();
  24.          setBackButton(_bMenu);
  25.          _loc1_ = 200;
  26.          _loc2_ = 100;
  27.          for each(_loc3_ in Database.getInstance().Levels)
  28.          {
  29.             (_loc4_ = new TextField()).background = true;
  30.             _loc4_.selectable = false;
  31.             _loc4_.border = true;
  32.             _loc4_.defaultTextFormat = new TextFormat("Arial");
  33.             addChildAt(_loc4_,1);
  34.             _loc4_.x = _loc2_;
  35.             _loc4_.y = _loc1_;
  36.             _loc4_.height = 20;
  37.             _loc4_.text = _loc3_.Name;
  38.             _loc4_.addEventListener(MouseEvent.CLICK,onLevelJump,false,0,true);
  39.             _loc4_.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
  40.             _loc4_.addEventListener(MouseEvent.MOUSE_OUT,onOut,false,0,true);
  41.             _loc1_ += 20;
  42.             if(_loc1_ > 650)
  43.             {
  44.                _loc1_ = 200;
  45.                _loc2_ += 200;
  46.             }
  47.          }
  48.       }
  49.       
  50.       public static function getLevelForm(param1:String) : BaseForm
  51.       {
  52.          var _loc2_:DressupForm = null;
  53.          var _loc3_:DressupLevelInfo = null;
  54.          var _loc4_:CutsceneForm = null;
  55.          _loc2_ = new DressupForm();
  56.          _loc3_ = new DressupLevelInfo(param1);
  57.          _loc2_.init(_loc3_);
  58.          if(_loc3_.LevelCutscene != "")
  59.          {
  60.             (_loc4_ = new CutsceneForm()).init(_loc2_,_loc3_.LevelCutscene);
  61.             return _loc4_;
  62.          }
  63.          return _loc2_;
  64.       }
  65.       
  66.       protected function onOut(param1:MouseEvent) : void
  67.       {
  68.          (param1.currentTarget as TextField).backgroundColor = 4294967295;
  69.       }
  70.       
  71.       override public function onFocus() : void
  72.       {
  73.          super.onFocus();
  74.          if(Profile.CurrentProfile.Ending == 1)
  75.          {
  76.             onBack(new MouseEvent(""));
  77.          }
  78.       }
  79.       
  80.       protected function onOver(param1:MouseEvent) : void
  81.       {
  82.          (param1.currentTarget as TextField).backgroundColor = 4294951104;
  83.       }
  84.       
  85.       protected function onLevelJump(param1:MouseEvent) : void
  86.       {
  87.          var _loc2_:String = null;
  88.          _loc2_ = (param1.currentTarget as TextField).text;
  89.          setForm(getLevelForm(_loc2_));
  90.       }
  91.    }
  92. }
  93.